Skip to content

Use scrollTop instead of getBoundingClientRect to control VirtualList rendering#4607

Merged
julienw merged 5 commits into
firefox-devtools:mainfrom
julienw:use-scrolltop
May 19, 2023
Merged

Use scrollTop instead of getBoundingClientRect to control VirtualList rendering#4607
julienw merged 5 commits into
firefox-devtools:mainfrom
julienw:use-scrolltop

Conversation

@julienw

@julienw julienw commented May 5, 2023

Copy link
Copy Markdown
Contributor

This patch does more things than what I initially wanted:

  • commit 1: minor refactoring in our ResizeObserver wrapper, that makes the commit 2 easier to follow. It's also more correct, because I believe that the current version would stop working if we unregistered all customers and register some new ones without creating the wrapper again.

  • commit 2: move the visibilitychange event handling from WithSize to the ResizeObserver wrapper, so that this behavior is present even when we don't use WithSize. I wonder if WithSize is even needed after this, we could just use the ResizeObserver wrapper directly now...

  • commit 3: this is the initial goal for this patch: scrollTop is used instead of getBoundingClientRect.

  • commit 4: this uses the ResizeObserver wrapper to capture the content height. This fixes another (not very visible) issue:

    1. reduce the height of the window,
    2. scroll in the marker table or the call tree,
    3. increase the height of the window

    => at one point, the panel is blank because it's not rerendered when the window's size changes.

production (notice that the marker table is blank below approximately half the height)
deploy preview

@julienw julienw requested a review from canova May 15, 2023 20:28

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me with the change in event type name I mentioned below. Thanks!

Comment thread src/utils/resize-observer-wrapper.js Outdated
@julienw julienw enabled auto-merge May 19, 2023 13:51
@julienw julienw merged commit 293a807 into firefox-devtools:main May 19, 2023
@canova canova mentioned this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants